\(\int \frac {\coth ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx\) [178]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 85 \[ \int \frac {\coth ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=-\frac {\coth ^2(c+d x)}{2 a d}+\frac {\log (\cosh (c+d x))}{(a+b) d}+\frac {(a-b) \log (\tanh (c+d x))}{a^2 d}+\frac {b^2 \log \left (a+b \tanh ^2(c+d x)\right )}{2 a^2 (a+b) d} \]

[Out]

-1/2*coth(d*x+c)^2/a/d+ln(cosh(d*x+c))/(a+b)/d+(a-b)*ln(tanh(d*x+c))/a^2/d+1/2*b^2*ln(a+b*tanh(d*x+c)^2)/a^2/(
a+b)/d

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3751, 457, 84} \[ \int \frac {\coth ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {b^2 \log \left (a+b \tanh ^2(c+d x)\right )}{2 a^2 d (a+b)}+\frac {(a-b) \log (\tanh (c+d x))}{a^2 d}+\frac {\log (\cosh (c+d x))}{d (a+b)}-\frac {\coth ^2(c+d x)}{2 a d} \]

[In]

Int[Coth[c + d*x]^3/(a + b*Tanh[c + d*x]^2),x]

[Out]

-1/2*Coth[c + d*x]^2/(a*d) + Log[Cosh[c + d*x]]/((a + b)*d) + ((a - b)*Log[Tanh[c + d*x]])/(a^2*d) + (b^2*Log[
a + b*Tanh[c + d*x]^2])/(2*a^2*(a + b)*d)

Rule 84

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rule 457

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 3751

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff/f), Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2
 + ff^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {1}{x^3 \left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\tanh (c+d x)\right )}{d} \\ & = \frac {\text {Subst}\left (\int \frac {1}{(1-x) x^2 (a+b x)} \, dx,x,\tanh ^2(c+d x)\right )}{2 d} \\ & = \frac {\text {Subst}\left (\int \left (-\frac {1}{(a+b) (-1+x)}+\frac {1}{a x^2}+\frac {a-b}{a^2 x}+\frac {b^3}{a^2 (a+b) (a+b x)}\right ) \, dx,x,\tanh ^2(c+d x)\right )}{2 d} \\ & = -\frac {\coth ^2(c+d x)}{2 a d}+\frac {\log (\cosh (c+d x))}{(a+b) d}+\frac {(a-b) \log (\tanh (c+d x))}{a^2 d}+\frac {b^2 \log \left (a+b \tanh ^2(c+d x)\right )}{2 a^2 (a+b) d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.21 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.71 \[ \int \frac {\coth ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=-\frac {\frac {\coth ^2(c+d x)}{a}-\frac {b^2 \log \left (b+a \coth ^2(c+d x)\right )}{a^2 (a+b)}-\frac {2 \log (\sinh (c+d x))}{a+b}}{2 d} \]

[In]

Integrate[Coth[c + d*x]^3/(a + b*Tanh[c + d*x]^2),x]

[Out]

-1/2*(Coth[c + d*x]^2/a - (b^2*Log[b + a*Coth[c + d*x]^2])/(a^2*(a + b)) - (2*Log[Sinh[c + d*x]])/(a + b))/d

Maple [A] (verified)

Time = 0.20 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.04

method result size
parallelrisch \(\frac {b^{2} \ln \left (a +b \tanh \left (d x +c \right )^{2}\right )-2 \ln \left (1-\tanh \left (d x +c \right )\right ) a^{2}+\left (2 a^{2}-2 b^{2}\right ) \ln \left (\tanh \left (d x +c \right )\right )-\coth \left (d x +c \right )^{2} a \left (a +b \right )-2 a^{2} d x}{2 d \,a^{2} \left (a +b \right )}\) \(88\)
derivativedivides \(-\frac {-\frac {b^{2} \ln \left (a +b \tanh \left (d x +c \right )^{2}\right )}{2 \left (a +b \right ) a^{2}}+\frac {\left (-a +b \right ) \ln \left (\tanh \left (d x +c \right )\right )}{a^{2}}+\frac {1}{2 a \tanh \left (d x +c \right )^{2}}+\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2 a +2 b}+\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2 a +2 b}}{d}\) \(100\)
default \(-\frac {-\frac {b^{2} \ln \left (a +b \tanh \left (d x +c \right )^{2}\right )}{2 \left (a +b \right ) a^{2}}+\frac {\left (-a +b \right ) \ln \left (\tanh \left (d x +c \right )\right )}{a^{2}}+\frac {1}{2 a \tanh \left (d x +c \right )^{2}}+\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2 a +2 b}+\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2 a +2 b}}{d}\) \(100\)
risch \(\frac {x}{a +b}-\frac {2 x}{a}-\frac {2 c}{d a}+\frac {2 b x}{a^{2}}+\frac {2 b c}{a^{2} d}-\frac {2 b^{2} x}{a^{2} \left (a +b \right )}-\frac {2 b^{2} c}{d \,a^{2} \left (a +b \right )}-\frac {2 \,{\mathrm e}^{2 d x +2 c}}{d a \left ({\mathrm e}^{2 d x +2 c}-1\right )^{2}}+\frac {\ln \left ({\mathrm e}^{2 d x +2 c}-1\right )}{d a}-\frac {\ln \left ({\mathrm e}^{2 d x +2 c}-1\right ) b}{d \,a^{2}}+\frac {b^{2} \ln \left ({\mathrm e}^{4 d x +4 c}+\frac {2 \left (a -b \right ) {\mathrm e}^{2 d x +2 c}}{a +b}+1\right )}{2 d \,a^{2} \left (a +b \right )}\) \(191\)

[In]

int(coth(d*x+c)^3/(a+b*tanh(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/2*(b^2*ln(a+b*tanh(d*x+c)^2)-2*ln(1-tanh(d*x+c))*a^2+(2*a^2-2*b^2)*ln(tanh(d*x+c))-coth(d*x+c)^2*a*(a+b)-2*a
^2*d*x)/d/a^2/(a+b)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 747 vs. \(2 (81) = 162\).

Time = 0.34 (sec) , antiderivative size = 747, normalized size of antiderivative = 8.79 \[ \int \frac {\coth ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=-\frac {2 \, a^{2} d x \cosh \left (d x + c\right )^{4} + 8 \, a^{2} d x \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + 2 \, a^{2} d x \sinh \left (d x + c\right )^{4} + 2 \, a^{2} d x - 4 \, {\left (a^{2} d x - a^{2} - a b\right )} \cosh \left (d x + c\right )^{2} + 4 \, {\left (3 \, a^{2} d x \cosh \left (d x + c\right )^{2} - a^{2} d x + a^{2} + a b\right )} \sinh \left (d x + c\right )^{2} - {\left (b^{2} \cosh \left (d x + c\right )^{4} + 4 \, b^{2} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + b^{2} \sinh \left (d x + c\right )^{4} - 2 \, b^{2} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, b^{2} \cosh \left (d x + c\right )^{2} - b^{2}\right )} \sinh \left (d x + c\right )^{2} + b^{2} + 4 \, {\left (b^{2} \cosh \left (d x + c\right )^{3} - b^{2} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )\right )} \log \left (\frac {2 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{2} + {\left (a + b\right )} \sinh \left (d x + c\right )^{2} + a - b\right )}}{\cosh \left (d x + c\right )^{2} - 2 \, \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + \sinh \left (d x + c\right )^{2}}\right ) - 2 \, {\left ({\left (a^{2} - b^{2}\right )} \cosh \left (d x + c\right )^{4} + 4 \, {\left (a^{2} - b^{2}\right )} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a^{2} - b^{2}\right )} \sinh \left (d x + c\right )^{4} - 2 \, {\left (a^{2} - b^{2}\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a^{2} - b^{2}\right )} \cosh \left (d x + c\right )^{2} - a^{2} + b^{2}\right )} \sinh \left (d x + c\right )^{2} + a^{2} - b^{2} + 4 \, {\left ({\left (a^{2} - b^{2}\right )} \cosh \left (d x + c\right )^{3} - {\left (a^{2} - b^{2}\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )\right )} \log \left (\frac {2 \, \sinh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right ) + 8 \, {\left (a^{2} d x \cosh \left (d x + c\right )^{3} - {\left (a^{2} d x - a^{2} - a b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )}{2 \, {\left ({\left (a^{3} + a^{2} b\right )} d \cosh \left (d x + c\right )^{4} + 4 \, {\left (a^{3} + a^{2} b\right )} d \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + {\left (a^{3} + a^{2} b\right )} d \sinh \left (d x + c\right )^{4} - 2 \, {\left (a^{3} + a^{2} b\right )} d \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a^{3} + a^{2} b\right )} d \cosh \left (d x + c\right )^{2} - {\left (a^{3} + a^{2} b\right )} d\right )} \sinh \left (d x + c\right )^{2} + {\left (a^{3} + a^{2} b\right )} d + 4 \, {\left ({\left (a^{3} + a^{2} b\right )} d \cosh \left (d x + c\right )^{3} - {\left (a^{3} + a^{2} b\right )} d \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )\right )}} \]

[In]

integrate(coth(d*x+c)^3/(a+b*tanh(d*x+c)^2),x, algorithm="fricas")

[Out]

-1/2*(2*a^2*d*x*cosh(d*x + c)^4 + 8*a^2*d*x*cosh(d*x + c)*sinh(d*x + c)^3 + 2*a^2*d*x*sinh(d*x + c)^4 + 2*a^2*
d*x - 4*(a^2*d*x - a^2 - a*b)*cosh(d*x + c)^2 + 4*(3*a^2*d*x*cosh(d*x + c)^2 - a^2*d*x + a^2 + a*b)*sinh(d*x +
 c)^2 - (b^2*cosh(d*x + c)^4 + 4*b^2*cosh(d*x + c)*sinh(d*x + c)^3 + b^2*sinh(d*x + c)^4 - 2*b^2*cosh(d*x + c)
^2 + 2*(3*b^2*cosh(d*x + c)^2 - b^2)*sinh(d*x + c)^2 + b^2 + 4*(b^2*cosh(d*x + c)^3 - b^2*cosh(d*x + c))*sinh(
d*x + c))*log(2*((a + b)*cosh(d*x + c)^2 + (a + b)*sinh(d*x + c)^2 + a - b)/(cosh(d*x + c)^2 - 2*cosh(d*x + c)
*sinh(d*x + c) + sinh(d*x + c)^2)) - 2*((a^2 - b^2)*cosh(d*x + c)^4 + 4*(a^2 - b^2)*cosh(d*x + c)*sinh(d*x + c
)^3 + (a^2 - b^2)*sinh(d*x + c)^4 - 2*(a^2 - b^2)*cosh(d*x + c)^2 + 2*(3*(a^2 - b^2)*cosh(d*x + c)^2 - a^2 + b
^2)*sinh(d*x + c)^2 + a^2 - b^2 + 4*((a^2 - b^2)*cosh(d*x + c)^3 - (a^2 - b^2)*cosh(d*x + c))*sinh(d*x + c))*l
og(2*sinh(d*x + c)/(cosh(d*x + c) - sinh(d*x + c))) + 8*(a^2*d*x*cosh(d*x + c)^3 - (a^2*d*x - a^2 - a*b)*cosh(
d*x + c))*sinh(d*x + c))/((a^3 + a^2*b)*d*cosh(d*x + c)^4 + 4*(a^3 + a^2*b)*d*cosh(d*x + c)*sinh(d*x + c)^3 +
(a^3 + a^2*b)*d*sinh(d*x + c)^4 - 2*(a^3 + a^2*b)*d*cosh(d*x + c)^2 + 2*(3*(a^3 + a^2*b)*d*cosh(d*x + c)^2 - (
a^3 + a^2*b)*d)*sinh(d*x + c)^2 + (a^3 + a^2*b)*d + 4*((a^3 + a^2*b)*d*cosh(d*x + c)^3 - (a^3 + a^2*b)*d*cosh(
d*x + c))*sinh(d*x + c))

Sympy [F]

\[ \int \frac {\coth ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\int \frac {\coth ^{3}{\left (c + d x \right )}}{a + b \tanh ^{2}{\left (c + d x \right )}}\, dx \]

[In]

integrate(coth(d*x+c)**3/(a+b*tanh(d*x+c)**2),x)

[Out]

Integral(coth(c + d*x)**3/(a + b*tanh(c + d*x)**2), x)

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 159, normalized size of antiderivative = 1.87 \[ \int \frac {\coth ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {b^{2} \log \left (2 \, {\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + {\left (a + b\right )} e^{\left (-4 \, d x - 4 \, c\right )} + a + b\right )}{2 \, {\left (a^{3} + a^{2} b\right )} d} + \frac {d x + c}{{\left (a + b\right )} d} + \frac {2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{{\left (2 \, a e^{\left (-2 \, d x - 2 \, c\right )} - a e^{\left (-4 \, d x - 4 \, c\right )} - a\right )} d} + \frac {{\left (a - b\right )} \log \left (e^{\left (-d x - c\right )} + 1\right )}{a^{2} d} + \frac {{\left (a - b\right )} \log \left (e^{\left (-d x - c\right )} - 1\right )}{a^{2} d} \]

[In]

integrate(coth(d*x+c)^3/(a+b*tanh(d*x+c)^2),x, algorithm="maxima")

[Out]

1/2*b^2*log(2*(a - b)*e^(-2*d*x - 2*c) + (a + b)*e^(-4*d*x - 4*c) + a + b)/((a^3 + a^2*b)*d) + (d*x + c)/((a +
 b)*d) + 2*e^(-2*d*x - 2*c)/((2*a*e^(-2*d*x - 2*c) - a*e^(-4*d*x - 4*c) - a)*d) + (a - b)*log(e^(-d*x - c) + 1
)/(a^2*d) + (a - b)*log(e^(-d*x - c) - 1)/(a^2*d)

Giac [A] (verification not implemented)

none

Time = 0.35 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.56 \[ \int \frac {\coth ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {\frac {b^{2} \log \left (a e^{\left (4 \, d x + 4 \, c\right )} + b e^{\left (4 \, d x + 4 \, c\right )} + 2 \, a e^{\left (2 \, d x + 2 \, c\right )} - 2 \, b e^{\left (2 \, d x + 2 \, c\right )} + a + b\right )}{a^{3} + a^{2} b} - \frac {2 \, {\left (d x + c\right )}}{a + b} + \frac {2 \, {\left (a - b\right )} \log \left ({\left | e^{\left (2 \, d x + 2 \, c\right )} - 1 \right |}\right )}{a^{2}} - \frac {4 \, e^{\left (2 \, d x + 2 \, c\right )}}{a {\left (e^{\left (2 \, d x + 2 \, c\right )} - 1\right )}^{2}}}{2 \, d} \]

[In]

integrate(coth(d*x+c)^3/(a+b*tanh(d*x+c)^2),x, algorithm="giac")

[Out]

1/2*(b^2*log(a*e^(4*d*x + 4*c) + b*e^(4*d*x + 4*c) + 2*a*e^(2*d*x + 2*c) - 2*b*e^(2*d*x + 2*c) + a + b)/(a^3 +
 a^2*b) - 2*(d*x + c)/(a + b) + 2*(a - b)*log(abs(e^(2*d*x + 2*c) - 1))/a^2 - 4*e^(2*d*x + 2*c)/(a*(e^(2*d*x +
 2*c) - 1)^2))/d

Mupad [B] (verification not implemented)

Time = 2.24 (sec) , antiderivative size = 313, normalized size of antiderivative = 3.68 \[ \int \frac {\coth ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {b^2\,\ln \left (3\,a\,b^2-2\,a^2\,b-2\,a^3+3\,b^3-4\,a^3\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}-2\,a^3\,{\mathrm {e}}^{4\,c}\,{\mathrm {e}}^{4\,d\,x}-6\,b^3\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+3\,b^3\,{\mathrm {e}}^{4\,c}\,{\mathrm {e}}^{4\,d\,x}+6\,a\,b^2\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+4\,a^2\,b\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+3\,a\,b^2\,{\mathrm {e}}^{4\,c}\,{\mathrm {e}}^{4\,d\,x}-2\,a^2\,b\,{\mathrm {e}}^{4\,c}\,{\mathrm {e}}^{4\,d\,x}\right )}{2\,d\,a^3+2\,b\,d\,a^2}-\frac {x}{a+b}-\frac {2}{a\,d\,\left ({\mathrm {e}}^{4\,c+4\,d\,x}-2\,{\mathrm {e}}^{2\,c+2\,d\,x}+1\right )}+\frac {\ln \left (4\,a^4\,b+9\,b^5-12\,a^2\,b^3-9\,b^5\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}-4\,a^4\,b\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}+12\,a^2\,b^3\,{\mathrm {e}}^{2\,c}\,{\mathrm {e}}^{2\,d\,x}\right )\,\left (a-b\right )}{a^2\,d}-\frac {2\,\left (a^2+b\,a\right )}{a^2\,d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}-1\right )\,\left (a+b\right )} \]

[In]

int(coth(c + d*x)^3/(a + b*tanh(c + d*x)^2),x)

[Out]

(b^2*log(3*a*b^2 - 2*a^2*b - 2*a^3 + 3*b^3 - 4*a^3*exp(2*c)*exp(2*d*x) - 2*a^3*exp(4*c)*exp(4*d*x) - 6*b^3*exp
(2*c)*exp(2*d*x) + 3*b^3*exp(4*c)*exp(4*d*x) + 6*a*b^2*exp(2*c)*exp(2*d*x) + 4*a^2*b*exp(2*c)*exp(2*d*x) + 3*a
*b^2*exp(4*c)*exp(4*d*x) - 2*a^2*b*exp(4*c)*exp(4*d*x)))/(2*a^3*d + 2*a^2*b*d) - x/(a + b) - 2/(a*d*(exp(4*c +
 4*d*x) - 2*exp(2*c + 2*d*x) + 1)) + (log(4*a^4*b + 9*b^5 - 12*a^2*b^3 - 9*b^5*exp(2*c)*exp(2*d*x) - 4*a^4*b*e
xp(2*c)*exp(2*d*x) + 12*a^2*b^3*exp(2*c)*exp(2*d*x))*(a - b))/(a^2*d) - (2*(a*b + a^2))/(a^2*d*(exp(2*c + 2*d*
x) - 1)*(a + b))